package testview.zhen.com.myapplication.jetpack

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Observer
import testview.zhen.com.myapplication.R

class LiveDataActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_live_data)
        var mutableValue =  MutableLiveData<String>()
        mutableValue.observe(this, Observer<String> { })
        mutableValue.postValue("使用postValue改变数据")
    }

}
